package sms

import (
	"testing"

	"gitcode.com/G-YT/baoyou/server/config"
	"gitcode.com/G-YT/baoyou/server/global"
)

//
//url: https://api-v4.mysubmail.com/sms/xsend
//appid: 113652
//project: ThD7i3
//appkey: 21482c5f6e4b52fc504d82b25dfe728c

// setupTestConfig 设置测试配置
func setupTestConfig() {
	global.GVA_CONFIG = config.Server{
		Submail: config.Submail{
			AppID:   "113652",
			AppKey:  "21482c5f6e4b52fc504d82b25dfe728c",
			Project: "ThD7i3",
			URL:     "https://api-v4.mysubmail.com/sms/xsend",
		},
	}
}

// TestSendSMS_Success 测试发送短信成功的情况
func TestSendSMS(t *testing.T) {
	setupTestConfig()
	err := SendSMS("17610710752", "123456")
	if err != nil {
		t.Errorf("发送短信失败: %v", err)
	}
}
